#include "cpu/exec/template-start.h"

#define instr lods

//串操作指令lods用于从内存加载数据到寄存器中
make_helper(concat(lods_, SUFFIX)) {
    current_sreg = R_DS;//提前设置好段寄存器DS
    REG(R_EAX) = MEM_R(cpu.esi);
    if(cpu.eflags.DF == 0){
        reg_l(R_ESI) += DATA_BYTE;
    }
    else{
        reg_l(R_ESI) -= DATA_BYTE;
    }
	print_asm("lods" str(SUFFIX) " %%ds:(%%esi),%%%s", REG_NAME(R_EAX));
	return 1;
}

#include "cpu/exec/template-end.h"
